import os
from tools.funciton import read_json_file, write_xlsx, timestamp_switch_date, replace_column_values,read_xlsx_file
from config.configs import DATA_PATH, DESKTOP_PATH, DOWNLOAD_PATH
from config.configs import DINGSTOCK_HOST, DINGSTOCK_PORT, GOAT_ERP_HOST, GOAT_ERP_PORT, DESKTOP_PATH, DATA_PATH
import pymongo
from tools.funciton import read_xlsx_file
import os
import jionlp as jio
import requests
import random
import string

ding = pymongo.MongoClient(host=DINGSTOCK_HOST, port=DINGSTOCK_PORT, authMechanism='DEFAULT', authSource='admin',
                           directConnection=True)
express = ding.express

# file = os.path.join(DOWNLOAD_PATH, '6月新生退款明细.xlsx')
#
# a = read_xlsx_file(file, 2)
# print(a)
#
#
# li = []
# for i in a:
#     res = express.balancerecords.find_one({"operateNumber": str(i)})
#     if res is not None:
#         li.append(i)
# print(li)
# li = [1719570801855773883, 1719570377608529234, 1719570374208916085, 1719570274727180960, 1719568613665940909, 1719562129384575852, 1719562084996286935, 1719562081592881770, 1719562078663752082, 1719561863901684338, 1719560111239031685, 1719560108175682280, 1719560094651781032, 1719559497032618346, 1719559487831479992, 1719556550281916581, 1719545143473244538, 1719545003064321498, 1719544766472302097, 1719540163148850650, 1719539977873639337, 1719539934532942943, 1719488072254587621, 1719488069216942628, 1719488058461032422, 1719488055497680268, 1719487256083093889, 1719477777606108689, 1719476472258470433, 1719476468640976639, 1719475451948392217, 1719473087789114531, 1719577770147796001, 1719576514844763600, 1719576511233783180, 1719576507903962709, 1719576284024843754, 1719576054253037404, 1717672083843637525, 1719314828680837218, 1719305909296861999, 1719305754166793832, 1718699360317695420, 1718598416954602645, 1718266452574735449, 1718245974920352937, 1718245510510546544, 1719306094232695893, 1719192161956815330, 1718691260488294553, 1718597777389116064, 1719488078916093119, 1719488052284067507, 1719461802739209865, 1718245588894876497, 1717676673544931042, 1718697117676723193, 1718245620797584292, 1718766751266548763, 1718251043456152279, 1718270159539963544, 1717403734897014325, 1718763502951454290, 1718693790796294125, 1718598085125719543, 1718598361802997230, 1718250554678127616, 1718264755118120741, 1718246157961749031, 1718246147514638846, 1718252017174205276, 1718101107636597966, 1718270279975139191, 1718250747468592588, 1718759464087665706, 1718698984404214907, 1718694022038363061, 1718598290212528184, 1718694933200500543, 1718693556803886288, 1718693490055358380, 1718604614154655256, 1718598166141695503, 1718597941905697436, 1718252101759028636, 1718693810929343423, 1718598224934823982, 1718699063984839388, 1718265268295035751, 1718277219033636648]
# li1 = [[str(i)] for i in li]
# print(li1)
# write_xlsx(['12'], li1, 'xxx')
